using System.Windows.Data;

namespace ibba.src.sl.recursos.Converters
{
    public class NotBooleanConverter: IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (typeof(bool) == value.GetType())
                return !(bool)value;
            else
                return false;
            
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (typeof(bool) == value.GetType())
                return !(bool)value;
            else
                return false;
        }

        #endregion
                
    }
}
